﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Romeo.Data
{
    public class FrontierEvaluator : DynamicEvaluator
    {
        private int _Score = -20;

        protected override void BuildScores (Board aBoard)
        {
            for (int i = Board.StartCell; i < Board.EndCell; i++)
            {
                if ((aBoard._Cells[i] == Board.Computer || aBoard._Cells[i] == Board.Opponent)
                    && (aBoard._Cells[i + 1] == Board.Empty || 
                        aBoard._Cells[i + 9] == Board.Empty || 
                        aBoard._Cells[i + 10] == Board.Empty || 
                        aBoard._Cells[i + 11] == Board.Empty || 
                        aBoard._Cells[i - 1] == Board.Empty || 
                        aBoard._Cells[i - 9] == Board.Empty || 
                        aBoard._Cells[i - 10] == Board.Empty || 
                        aBoard._Cells[i - 11] == Board.Empty))
                {
                    _Scores[i] = _Score;
                }
            }
        }

    }
}
